package cn.tedu._05mvcboot03.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;


@Data
public class UserArticleDTO {
    @ApiModelProperty(value = "文章标题",required = true)
//    @Pattern(regexp = "^.{1,20}$",message = "标题不能为空白,1-20个字")
    @NotBlank(message = "标题不能为空白")
    @Size(min = 1, max = 20, message = "标题长度为1-20")
    private String title;
    @ApiModelProperty(value = "文章内容",required = true)
//    @Pattern(regexp = "^.{10,500}$",message = "标题不能为空白,10-500个字")
    @NotBlank(message = "文章内容不能为空白")
    @Size(min = 10, max = 500, message = "文章内容长度为10-500")
    private String content;
}
